import requests
from requests.structures import CaseInsensitiveDict

# URL和查询参数
url = "https://www.ps8989.com/member-service/v2/authenticate"
params = {
    "locale": "zh_CN",
    "_": "1742572195920",
    "withCredentials": "true"
}

# 请求头
headers = CaseInsensitiveDict()
headers["Host"] = "www.ps8989.com"
headers["Content-Length"] = "60"
headers["Sec-Ch-Ua-Platform"] = "Windows"
headers["Trust-Code"] = ""
headers["Sec-Ch-Ua"] = 'Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"'
headers["Sec-Ch-Ua-Mobile"] = "?0"
headers["X-App-Data"] = "Z2r=s9HzuvE8JI7AaTZl;pctag=441d69b6-796f-4438-ac74-3c3d2818e690"
headers["X-Trust-Client"] = "false"
headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
headers["Accept"] = "application/json, text/plain, */*"
headers["Content-Type"] = "application/x-www-form-urlencoded"
headers["Origin"] = "https://www.ps8989.com"
headers["Sec-Fetch-Site"] = "same-origin"
headers["Sec-Fetch-Mode"] = "cors"
headers["Sec-Fetch-Dest"] = "empty"
headers["Referer"] = "https://www.ps8989.com/zh-cn/compact/sports"
headers["Accept-Encoding"] = "gzip, deflate, br"
headers["Accept-Language"] = "zh-CN,zh;q=0.9"
headers["Priority"] = "u=1, i"

# 请求体数据
data = {
    "captcha": "",
    "captchaToken": "",
    "loginId": "K961L00003",
    "password": "QSZ336699"
}

session = requests.Session()
# 发送POST请求
response = session.post(url, params=params, headers=headers, data=data)

# 打印响应内容
print(response.status_code)
print(response.text)

cookies = session.cookies
print("Cookies:", dict(cookies))
